package com.example.dao;

import com.example.entity.Goods;
import com.example.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
@Mapper
public interface TeacherDao {
    Goods findById(@Param("gid") Integer gid);
    //遍历所有商品
    List<Goods> findAll();

    /**
     * 根据条件查询用户及其商品
     */
    List<Goods> getGoodsByTeacherName(String name);
     //增加
    int insert(Goods goods);
    //修改
    int update(Goods goods);
    //删除
    int delete(@Param("gid") Integer gid);

    List<User> getUserByTeacherName (String name);
    User findByAuthor(int gid);

}
